<template>
  <section v-loading="loading" class="cms-body">
    <div class="cms-list-header flex-between">
      <div>
        <el-select v-model="params.status" @change="goQuery">
          <el-option label="爆料状态" value=""></el-option>
          <el-option label="待判" value="0"></el-option>
          <el-option label="已采用" value="1"></el-option>
          <el-option label="不合用" value="2"></el-option>
        </el-select>
        <cms-input label="标题" v-model="params.title"></cms-input>
        <el-button @click="goQuery()">查询</el-button>
      </div>
    </div>

    <!-- 表格 -->
    <el-table :data="tableData" stripe style="width: 100%" @selection-change="checkIds">
      <el-table-column type="selection" width="35" align="center"></el-table-column>
      <el-table-column prop="id" label="id" width="150" align="center"></el-table-column>
      <el-table-column prop="nickName" label="用户姓名" width="120" align="center">
        <div slot-scope="scope">
          <p style="color: #FFA500" @click="routerLink('/appUser/pageList','pageList',scope.row.appUserId)">
            {{scope.row.nickName}}</p>
        </div>
      </el-table-column>
      <el-table-column prop="mobile" label="电话/邮箱" width="145" align="center">
        <div slot-scope="scope">
          <span>{{(scope.row.mobile==''||scope.row.mobile==null)?scope.row.email: scope.row.mobile}}</span>
        </div>
      </el-table-column>
      <el-table-column prop="title" label="爆料标题" width="100" align="left"></el-table-column>
      <el-table-column prop="remark" label="备注" width="100" align="center"></el-table-column>
      <!-- <el-table-column prop="description" label="爆料内容" width="120" align="center">
         <div slot-scope="scope">
           <span>{{scope.row.description | textNumFilter}}</span>
         </div>
       </el-table-column>-->
      <el-table-column prop="status" label="爆料类型" align="center" width="60">
        <div slot-scope="scope">
          <span v-if="scope.row.mediaType=='picture'">图片</span>
          <span v-if="scope.row.mediaType=='video'">视频</span>
          <span v-if="scope.row.mediaType=='audio'">音频</span>
        </div>
      </el-table-column>
      <el-table-column prop="status" label="爆料状态" align="center" width="60">
        <div slot-scope="scope">
          <span v-if="scope.row.status==0">待判</span>
          <span v-if="scope.row.status==1">已采用</span>
          <span v-if="scope.row.status==2">不合用</span>
        </div>
      </el-table-column>
      <el-table-column prop="factAddress" label="爆料地址" width="120" align="center"></el-table-column>
      <el-table-column prop="rewardAmount" label="奖励金" width="120" align="center"></el-table-column>
      <el-table-column prop="checkTime" label="审核日期" width="120" align="center"></el-table-column>
      <el-table-column prop="createTime" label="创建日期" width="120" align="center"></el-table-column>
      <el-table-column label="操作" align="center" width="80">
        <div slot-scope="scope">
          <cms-button type="edit" @click.native="routerLink('/fact/update','update',scope.row.id)"
                      v-perms="'/fact/update'"></cms-button>
          <cms-button type="delete" @click.native="deleteBatch($api.factDelete,scope.row.id)"
                      v-perms="'/fact/delete'"></cms-button>
        </div>
      </el-table-column>
    </el-table>

    <!-- 表格底部 -->
    <div class="cms-list-footer">
      <div class="cms-left">
        <el-button :disabled="disabled" @click="deleteBatch($api.factDelete,ids)" v-perms="'/fact/delete'">批量删除
        </el-button>
      </div>
      <cms-pagination :total="total" @change="getPages"></cms-pagination>
    </div>

  </section>
</template>

<script>
  import listMixins from '@/mixins/list'

  export default {
    mixins: [listMixins],
    data() {
      return {
        params: {//只需要业务参数
          pageNo: 1,
          pageSize: 10,
          title: '',
          status: ''
        }
      };
    },
    methods: {
      goQuery() {
        this.getTableData(this.params);
      }
    },
    created() {
      this.initTableData(this.$api.factPageList, this.params);
    }
  };
</script>

<style>

</style>
